//
//  Dog.m
//  DogRule
//
//  Created by gzjd on 2017/5/7.
//  Copyright © 2017年 gzjd. All rights reserved.
//

#import "Dog.h"

@implementation Dog
@synthesize ID=_ID;
@synthesize delegate;
-(id) init{
    self=[super init];
    if(self){
 
        timer=[NSTimer  scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(updateTimer:) userInfo:nil repeats:YES];
//        [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
    }
    return self;
}
-(void)updateTimer:(id)arg{
    barkCount++;
    NSLog(@"dog bark %d",barkCount);
    [delegate bark:self count:barkCount];
}
@end
